#pragma once

#include "device_base.h"


class device_discover 
{
public:
	device_discover(void);
	~device_discover(void);

public:
	virtual int discover_devices(char * parameter, char device_pathes[32][256]);

	virtual int enum_and_create_devices(char * parameter);

	virtual int update_devices(int * removed_num, int * new_num, char * parameter);

	virtual device_base * get_device(int index);

	virtual int get_device_number();

	virtual device_base * get_first_device(MK_POSITION & pos);

	virtual device_base * get_next_device(MK_POSITION & pos);

	virtual device_base * get_device_by_position(MK_POSITION pos);

	virtual int destroy_removed_deviced();

	virtual device_base * add_new_device(char * dev_path, MK_HANDLE devHandle);

	virtual int delete_device(MK_POSITION pos);

protected:
	int split_enum_strings( char * input, char scsi_enum_id[256], char scsi_waitfor_id[256], char hid_enum[1024] );

	int split_hid_strings( char * input, char hidEnum[16][256]);

private:
	void ltrim ( char *s );
	 
};
